package cn.ad.server.web.spring.model.gdt.server;

import cn.ad.server.domain.enumration.AdFormat;

import java.util.HashMap;
import java.util.Map;

/**
 * @author dongbin.yu
 * @from 2016-10-11
 * @since V1.0
 */
public enum GDTServerAdFormat {

    BANNER(AdFormat.BANNER, 1),
    TABLE_SCREEN(AdFormat.TABLE_SCREEN, 2),
    OPEN_SCREEN(AdFormat.OPEN_SCREEN, 4),
    AD_NATIVE(AdFormat.AD_NATIVE, 8);

    public final static Map<AdFormat, Integer> AD_FORMAT_MAP = new HashMap<>();

    static{
        for (GDTServerAdFormat gdtServerAdFormat : GDTServerAdFormat.values()) {
            AD_FORMAT_MAP.put(gdtServerAdFormat.adFormat, gdtServerAdFormat.gdtAdFormat);
        }
    }

    private AdFormat adFormat;

    private int gdtAdFormat;

    GDTServerAdFormat(AdFormat adFormat, int gdtAdFormat) {
        this.adFormat = adFormat;
        this.gdtAdFormat = gdtAdFormat;
    }

}
